package com.loyi.cloud.hbmis.domain;

import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.PropertyAccessorUtils;
import org.springframework.boot.bind.PropertySourceUtils;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 图片路径
 * 
 * @author Lenovo
 *
 */
public class PictureData extends EntityBase {

	private int picid;
	private String ptid;
	private String deviceid;
	private String binarydata;

	private long datatime;
	private long uploadtime;
	private int imagewidth;
	private int imageheight;
	private long size;
	private String thumbimage;

	private byte[] data;
	private byte[] thumbData;

	public int getPicid() {
		return picid;
	}

	public void setPicid(int picid) {
		this.picid = picid;
	}

	public String getPtid() {
		return ptid;
	}

	public void setPtid(String ptid) {
		this.ptid = ptid;
	}

	public String getDeviceid() {
		return deviceid;
	}

	public void setDeviceid(String deviceid) {
		this.deviceid = deviceid;
	}

	public String getBinarydata() {
		return binarydata;
	}

	public void setBinarydata(String binarydata) {
		this.binarydata = binarydata;
	}

	public long getSize() {
		return size;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public String getThumbimage() {
		return thumbimage;
	}

	public void setThumbimage(String thumbimage) {
		this.thumbimage = thumbimage;
	}

	public long getDatatime() {
		return datatime;
	}

	public void setDatatime(long datatime) {
		this.datatime = datatime;
	}

	public long getUploadtime() {
		return uploadtime;
	}

	public void setUploadtime(long uploadtime) {
		this.uploadtime = uploadtime;
	}

	public int getImagewidth() {
		return imagewidth;
	}

	public void setImagewidth(int imagewidth) {
		this.imagewidth = imagewidth;
	}

	public int getImageheight() {
		return imageheight;
	}

	public void setImageheight(int imageheight) {
		this.imageheight = imageheight;
	}

	public void setData(byte[] data) {
		this.data = data;
	}

	public void setThumbData(byte[] thumbData) {
		this.thumbData = thumbData;
	}

	public byte[] getData() {
		return data;
	}

	public byte[] getThumbData() {
		return thumbData;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		for (PropertyDescriptor desc : BeanUtils.getPropertyDescriptors(this.getClass())) {

			try {
				sb.append(String.format("%s=%s\r\n", desc.getName(), desc.getReadMethod().invoke(this)));
			} catch (IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IllegalArgumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (InvocationTargetException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return sb.toString();
	}

}
